package mes.kanban.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

/**
 * 密码加密类
 * @author gjy
 *
 * 2018年2月11日下午7:51:04
 * 
 * 系统完成以后启用对注册密码加密
 */
public class PasswordUtil {
	
	private final static String algorithmName = "md5";
	
    private final static int hashIterations = 2;
	
	public static String returnPasswordByMD5(String salt,String password) {
		
		String newPassword = new SimpleHash(algorithmName, password,  ByteSource.Util.bytes(salt), hashIterations).toHex();
		
		return newPassword;
	}

}
